import { ref } from 'vue'
import { defineStore } from 'pinia'

export const useSeriesStore = defineStore("seriesSeries", () => {
  const isShow = ref(false)
  const data = ref([])

  function show() {
    isShow.value = true
  }

  function hidden() {
    isShow.value = false
  }

  function setData(param) {
    data.value = param
  }

  function getData() {
    return data.value
  }

  return { isShow, show, hidden, data, setData, getData }
})

export const useFactoryStore = defineStore("seriesFactory", () => {
  const isShow = ref(false)
  const data = ref([])

  function show() {
    isShow.value = true
  }

  function hidden() {
    isShow.value = false
  }

  function setData(param) {
    data.value = param ? param : []
  }

  function getData() {
    return data.value
  }

  return { isShow, data, show, hidden, setData, getData }
})

export const useModelStore = defineStore("seriesModel", () => {
  const isShow = ref(false)
  const data = ref([])

  function show() {
    isShow.value = true
  }

  function hidden() {
    isShow.value = false
  }

  function setData(param) {
    data.value = param
  }

  function getData() {
    return data.value
  }

  return { isShow, show, hidden, data, setData, getData }
})

export const useWarehousingStore = defineStore("seriesWarehousing", () => {
  const isShow = ref(false)

  function show() {
    isShow.value = true
  }

  function hidden() {
    isShow.value = false
  }

  return { isShow, show, hidden }
})